<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<html>
<body>
<script type="text/javascript" src="/admin/js/jscharts.js" charset="UTF-8"></script>
<script language="javascript" type="text/javascript">
function showChart(){
	var myChart = new JSChart('graph', 'line');
	myChart.setDataArray([
							<c:forEach var="c1" items="${all.picList}" varStatus="vs">
								[${c1.level},${c1.people}]
								<c:if test="${vs.count <= 60}">
									,
								</c:if>
							</c:forEach>
	                      ], 'red');
	myChart.setAxisPaddingBottom(40);
	myChart.setTextPaddingBottom(10);
	//myChart.setAxisValuesNumberY(5);
	myChart.setTitle('充值等级分布,注:大于60级都归为61');
	myChart.setIntervalStartY(0);
	//myChart.setIntervalStartX(1);
//	myChart.setIntervalEndY(200000);
	<c:forEach var="c1" items="${all.picList}" varStatus="vs">
		myChart.setLabelX([${vs.count},'${c1.level}']);
	</c:forEach>
	myChart.setAxisValuesNumberX(61);//设置x轴坐标有几个点
	myChart.setShowXValues(false);
	myChart.setTitleColor('#454545');
	myChart.setAxisValuesColor('#454545');
	myChart.setLineColor('#AB0707', 'red');
	//myChart.setLineColor('#37AA03', 'green');
	<c:forEach var="c1" items="${all.picList}" varStatus="vs">
		myChart.setTooltip([${vs.count}]);
	</c:forEach>
	myChart.setFlagColor('#9D16FC');
	myChart.setFlagRadius(3);
	myChart.setBackgroundImage('');
	myChart.setSize(1120, 400);
	myChart.draw();
}

var clickTimes = 0;
function seePic(){
	clickTimes++;
	if(clickTimes == 1){
		showChart();
	}
	if(clickTimes % 2 == 0){
		$("#container").hide();
		$("#lookChart").html("查看图表");
	}else{
		$("#container").show();
		$("#lookChart").html("收起图表");
	}
}
</script>
<form class="form-inline" action="" method="post">
<table>
<tr>
<td>用户id：<input type="text" name="playerId" value=""/></td>
<td>订单号： <input type="text" name="orderId" value=""/></td>
<td></td>
</tr>
<tr>
<td>从<div class="datepicker input-append">
    <input data-format="yyyy-MM-dd" type="text" value="${beginDate}" name="beginDate"></input>
    <span class="add-on">
      <i data-time-icon="icon-time" data-date-icon="icon-calendar">
      </i>
    </span>
  </div></td>
<td>到
  <div class="datepicker input-append">
    <input data-format="yyyy-MM-dd" type="text" value="${endDate}" name="endDate"></input>
    <span class="add-on">
      <i data-time-icon="icon-time" data-date-icon="icon-calendar">
      </i>
    </span>
  </div></td>
  <td>
  	<button type="submit" class="btn">查询</button>
  	<button type="button" class="btn" id="lookChart" onclick="seePic();">查看图表</button>
  </td>
</tr>
  </table>
</form>
<div id="container" >
	<div id="graph"></div>
</div>
<table class="table table-bordered">
  <thead>
    <tr> 	 	 			 	
      <th>订单号</th>
      <th>充值时间</th>
      <th>充值方式</th>
      <th>充值金额(RMB)</th>
      <th>充值ID</th>
      <th>状态</th>
    </tr>
  </thead>
  <tbody>
  <c:forEach var="m" items="${all.list}">
    <tr>
    <td>${m.orderId}</td>
      <td>${m.atTime}</td>
      <td>${m.payType == 3 ? '支付宝' : m.payType == 24 ? '网银' : m.payType == 25 ? '手机充值' : m.payType == 27 ? '手机短信' : m.payType == 29 ? '财付通' : m.payType == 100 ? '游戏卡' : m.payType == 20 ? '游戏卡-骏网' : m.payType == 21 ? '游戏卡 -盛大' : m.payType == 22 ? '游戏卡-网易' : m.payType == 23 ? '游戏卡-征途' : m.payType}</td>
      <td>${m.gold/100}</td><!-- K币/100 = RMB -->
      <td><tags:user id="${m.kugouId}"></tags:user></td>
      <td>${m.accountId}</td>
    </tr>
  </c:forEach>
  </tbody>
</table>
<c:if test="${!empty all.list}">
<tags:page1 page="${page}" pageSize="${pageSize }" total="${all.total }" url="?playerId=${playerId }&beginDate=${beginDate}&endDate=${endDate}&page="/>
</c:if>


</body>
</html>